package com.tecode.user.web;

import com.tecode.user.dao.UserDao;
import com.tecode.user.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consume")
public class ConsumerController {

    @Autowired
    private UserDao userDao;

    @GetMapping("/{id}")
    public User consume(@PathVariable("id") int id) {
        System.out.println("id:" + id);


        return this.userDao.queryUserById(id);
    }
}